﻿<?php
error_reporting(0);
include_once '../comm/conn.php';
include_once '../comm/func.php';
include_once 'check.php';
//请不要随意修改代码，凡是随意修改代码造成的一切后果均由修改者本人承担，多多不再提供技术支持	
$usernick=$_POST['usernick']; 
$appKey=$_POST['appKey']; 
$appSecret=$_POST['appSecret']; 
$appKey2=$_POST['appKey2']; 
$appSecret2=$_POST['appSecret2'];
$appKey3=$_POST['appKey3']; 
$appSecre3t=$_POST['appSecret3'];
$appKey4=$_POST['appKey4']; 
$appSecre4t=$_POST['appSecret4'];
$appKey5=$_POST['appKey5']; 
$appSecret5=$_POST['appSecret5'];
$userpid=$_POST['userpid'];

$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {die('数据库链接出错: ' . mysql_error());}
mysql_select_db($dbname);
mysql_query("set names utf8");
$q = "update ".$BIAOTOU."taobaoset set usernick='".$usernick."',appKey='".$appKey."',appSecret='".$appSecret."',appKey2='".$appKey2."',appSecret2='".$appSecret2."',appKey3='".$appKey3."',appSecret3='".$appSecret3."',appKey4='".$appKey4."',appSecret4='".$appSecret4."',appKey5='".$appKey5."',appSecret5 ='".$appSecret5."',userpid ='".$userpid."'";
//echo $q;
mysql_query($q);

$cfg_sql2="select * from ".$BIAOTOU."taobaoset where Id=1";
$cfg_rs2 = mysql_query($cfg_sql2);
while ($cfg_row2 = mysql_fetch_array($cfg_rs2)){
	define('MYAPPKEY',$cfg_row2["appKey"]);
	define('MYUSERNICK',urldecode($cfg_row2["usernick"]));
	define('MYAPPSECRET',$cfg_row2["appSecret"]);
	define('MYUSERPID',$cfg_row2["userpid"]);
	define('APPKEY2',$cfg_row2["appkey2"]);
	define('APPKEY3',$cfg_row2["appkey3"]);
	define('APPKEY4',$cfg_row2["appkey4"]);
	define('APPKEY5',$cfg_row2["appkey5"]);
	define('APPSECRET2',$cfg_row2["appsecret2"]);
	define('APPSECRET3',$cfg_row2["appsecret3"]);
	define('APPSECRET4',$cfg_row2["appsecret4"]);
	define('APPSECRET5',$cfg_row2["appsecret5"]);
}

//include_once 'write_config.php';

mysql_close($link);
echo "<script language=javascript>alert('淘宝客信息更新成功！即将跳转到淘宝客信息设置...');window.location='taobaokeset.php'</script>";

?>
